cmake_minimum_required(VERSION 3.12.0)

project(apollo_gui)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

## --------------------------------------------------
# CMake 参数配置部分 开始
## --------------------------------------------------
## 设置 Qt5 程序路径
if (NOT Qt5_DIR)
set(Qt5_DIR /usr/local/Qt5.12.0/5.12.0/gcc_64/lib/cmake/Qt5)
## 设置源文件目录
set(SRC_DIRS src)
## 设置头文件目录
set(INC_DIRS
	${CMAKE_CURRENT_BINARY_DIR}
	${PROJECT_SOURCE_DIR}/${SRC_DIRS}
	${Qt5Widgets_INCLUDES}
	${Python3_INCLUDE_DIRS}
)
## 设置库文件目录
set(LIB_DIRS
	${PROJECT_SOURCE_DIR}/lib
)
## Apollo_Gui 程序配置
### 设置 Qt 头文件列表
set(QT_HDRS
${SRC_DIRS}/mainwindow.h
)
### 设置 Qt 源文件列表
set(QT_SRCS
	${SRC_DIRS}/mainwindow.cpp
	${SRC_DIRS}/main.cpp
	${SRC_DIRS}/mainwindow.ui
)
### 设置 Qt 库文件列表
set(QT_LIBS
	Qt5::Widgets
)

# --------------------------------------------------
# CMake 参数配置部分 结束
# --------------------------------------------------


# 以下非特殊需求无需修改，非懂勿动
find_package(Python3 COMPONENTS Development NumPy REQUIRED)
find_package(Qt5 COMPONENTS Widgets CONFIG REQUIRED)

add_definitions(${Qt5Widgets_DEFINITIONS})

include_directories(${INC_DIRS}
        ${CMAKE_CURRENT_BINARY_DIR}
    )
link_directories(${LIB_DIRS})

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
add_executable(apollo_gui
	${QT_HDRS}
  ${QT_SRCS}
  ${ui_FILES}
	${MAINWINDOW_H}
)
target_link_libraries(apollo_gui
	${QT_LIBS}
)
